/**
 * 
 */
package util;

import java.sql.Connection;

import partitioner.PartitionDAODatabaseImpl;

/**
 * @author puneet
 * 
 */
public class TestComponentsUtil {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		String op = args[0];
		if ("testdbconn".equalsIgnoreCase(op)) {
			Connection conn = DBUtil.getConnection();
			DBUtil.closeConnection(conn);
		}
		if ("runquery".equalsIgnoreCase(op)) {
			PartitionDAODatabaseImpl db = new PartitionDAODatabaseImpl(DBUtil.getConnection());
			db.setDebug(true);
			for (int i = 0; i < Integer.parseInt(args[2]); i++) {
				System.out.println(db.getNeighbors(args[1]));
			}
		}
	}

}
